<template>
	<view class="container">
		<view class="form">
			<text class="title">登录</text>
			<view class="input-group"><input v-model="username" placeholder="请输入用户名" /></view>
			<view class="input-group"><input v-model="password" placeholder="请输入密码" /></view>
			<button class="btn" type="primary" @click="handleLogin">登录</button>	
				<view class="link-t"><text>没有账号？</text></view>
				<view class="link">
				<navigator url="/pages/register/register">去注册</navigator>
			</view>
		</view>
	</view>
</template>
S
<script>
	export default {
		data() {
			return {
				username:'',
				password:''
			}
		},
		methods: {
			handleLogin() {
				if (!this.username || !this.password) {
					uni.showToast({
						title:'请输入完整信息',
						icon:'none'
					})
					return
				}
				uni.switchTab({
					url:"/pages/components-two/cardViewPage/cardViewPage"
				})
				if(this.userName){
					console.log("tabcomnPage-->data:"+ this.username);
				uni.setStorage({
					key:'userName',
					data:this.username,
					success:function(){
						console.log("setStorage");
					}
				})
				}
			}
		}
	}
</script>

<style>

</style>
